package edu.ahut.ssm;

public class AlgorithmComplexity {
    static void poly(int n) {
        int cnt = 0;
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                for (int k = 0; k < n; k++) {
                    cnt++;
                }
        System.out.println(cnt);
    }

    static void exp(int n) {
        int cnt = 0;
        for (int i = 0; i < (1 << n); i++) {
            String s = Integer.toBinaryString(i);
            while (s.length() < n) {
                s = "0" + s;
            }
            System.out.println(s);
            cnt++;

        }
        System.out.println(cnt);
    }

    static void perm() {
        for (int i = 1; i <= 3; i++)
            for (int j = 1; j <= 3; j++)
                for (int k = 1; k <= 3; k++) {
                    System.out.println(i + " " + j + " " + k);
                }
    }

    public static void main(String[] args) {
        // poly(20);//O(n^3)
        //exp(10);
        perm();//O(n^n)
    }
}
